-- Headquarters of the Diduma Rebellion.


function autoexec()
if (get_progress(P_QUEST1) == 8) then
  set_ent_active(12,0)
  wait_for_entity(HERO1, HERO1)
  clear_buffer()
  screen_dump()
  do_fadein(25)
  --set_desc(0)
  set_autoparty(1)
  --set_vfollow(1)
  set_ent_speed(HERO1, 4)
  set_ent_script(HERO1, "D1")
  wait_for_entity(HERO1, HERO1)
  set_ent_script(HERO1, "L5D2L2D2L2D4L8")
  set_ent_script(HERO2, "D1L5D2L2D2L2D4L6")
  wait_for_entity(HERO1, HERO1)
  wait_for_entity(HERO2, HERO2)
  set_ent_facing(HERO1, FACE_UP)
  set_ent_facing(HERO2, FACE_UP)
  -- They give their speeches
   bubble(0,"You have the key I presume.");
   bubble(HERO1,"I do sir.");
   bubble(3,"Good Good.");
   bubble(4,"Thats a good boy. I knew you would grow up to honor your father one day.");
   bubble(1,"For your efforts I now prounounce you and $1 both full members of the Order of the Kings.");
   bubble(8,"Hear Hear!");
   bubble(0,"The Order was created the day the King of Diduma, Amalric the Mighty, fell to that scoundrel of a King, Omerus.");
   bubble(6,"It was a fateful day.");
   bubble(3,"Many to this day are imprisoned in the Citadel of Akanthos.");
   bubble(HERO2,"It is true. My uncle, King Amalric the Mighty is still shamefully confined from his people.");
   set_ent_facing(HERO1, FACE_RIGHT)
   wait_for_entity(HERO1, HERO1)
   wait(50)
   bubble(HERO1,"Did you just say...");
   bubble(0,"Correct $1, that is why we called you and $0 here.");
   bubble(1,"It is time for Diduma to be avenged!");
   set_ent_facing(HERO1, FACE_UP)
   wait_for_entity(HERO1, HERO1)
   bubble(4,"Today is the Day!");
   bubble(8,"Hear Hear!"); 
   bubble(8,"Diduma shall rise again in Glory!");
   bubble(1,"Omerus shall fall!");
   bubble(0,"In behalf of the Order of the Kings, I ask you $0 to infiltrate Akanthos and save our beloved King.");
   bubble(0,"Do you accept?");
   bubble(HERO1,"Yes.");
   bubble(HERO1,"My father will not have died in vain!");
   bubble(4,"You honor us $0 the Fierce.");
   bubble(0,"Your journey will be long and hard.");
   bubble(1,"You must go to the Citadel.");
   bubble(0,"And find a way into that Citadel");
   bubble(3,"When you find a way, go to the port city of Yarmouth. You will find a friend on the docks there.");
   bubble(0,"Send word back and we will raise the army to meet you at the Great Plain.");
   bubble(1,"You must not fail to free Amalric.");
   bubble(HERO1,"How shall I get into Akanthos. The Border is to well watched.");
   bubble(4,"That is the whole reason you got that key my boy.");
   bubble(0,"There is a small clearing in the forest due south of the capital.");
   bubble(1,"You will find a boulder in the clearing that conceals a hidden stairway.");
   bubble(0,"The tunnel leads to a tower on the otherside of the border. Your key will be needed to open the door to the tower.");
   bubble(0,"Go my son.");
   bubble(HERO2,"I will go with you as far as the tunnel exit. I must remain behind for I am the heir.");
   set_progress(P_QUEST1,9)
   set_progress(P_STONE,1)
   set_autoparty(0)
  else
    set_ent_active(0,0)
    set_ent_active(1,0)
    set_ent_active(3,0)
 --   set_ent_active(4,0)
    set_ent_active(5,0)
    set_ent_active(6,0)
    set_ent_active(7,0)
    set_ent_active(8,0)
    set_ent_active(9,0)
    set_ent_active(10,0)
--    set_ent_active(11,0)
end

return
end


function postexec()
return
end


function zone_handler(zn)
  if (zn == 1) then
    change_map("tunnel","hq_exit");

  elseif (zn == 2) then
    bubble(en,"I better not take anything now that they have let me into the order.");

  elseif (zn == 3) then
    bubble(en,"I better not take anything now that they have let me into the order.");
 
  end

           end

function entity_handler(en)
  if (en == 0) then
    bubble(en,"Your journey will be long and hard.");
   
  elseif (en == 1) then
    bubble(en,"It is time for Diduma to be avenged!");

  elseif (en == 2) then
    bubble(en,"Grunt");

  elseif (en == 3) then
    bubble(en,"When you find a way into the citadel, go to the port city of Yarmouth. Tell our friend on the docks there.");
    bubble(en,"Then the only thing you will have to do is free the King and bring him to the Great Plain.");
    
  elseif (en == 4) then
   bubble(HERO1,"Madam Marigold, where do I go again?");  
   bubble(en,"There is a small clearing in the forest due south of the capital. You will find a boulder in the clearing that conceals a hidden stairway.");
   bubble(HERO1,"What am I supposed to do with the boulder?");
   bubble(en,"Just push it out of the way.");
  
  elseif (en == 5) then
   bubble(en,"You are going to do just fine.");

  elseif (en == 6) then
   bubble(en,"Good luck.");

  elseif (en == 7) then
   bubble(en,"Go avenge your Father.");

  elseif (en == 8) then
   bubble(en,"Hear Hear!");

  elseif (en == 9) then
   bubble(en,"ZZZ... What?");

  elseif (en == 10) then
    bubble(en,"I know you will save the king.");

  elseif (en == 11) then
    bubble(en,"I'm the cook for the Order of the Kings.");

  elseif (en == 12) then
    bubble(en,"Zzzz");

   end
  end

